package cn.edu.wynu;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component("zrk")
// <bean id="zrk" class="cn.edu.wynu.Studnet"/>
public class Student {

    @Value("张绕坤")
    // <property name="name" value="张绕坤"/>
    String name;
    @Value("25")
    int age;

    @Autowired
    //<ref="">
    Computer notebook;

    @Resource
    Computer notebook1;

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", notebook=" + notebook +
                '}';
    }
}
